#include <bits/stdc++.h>
using namespace std;
const int maxn = 131072 * 3;
const int INF = 1e9 + 100;
const int BITS = 20;
int go[maxn][BITS];
int last[maxn][BITS];
void solve() {
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int j = 0; j < BITS; j++) {
    last[n][j] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < BITS; j++) {
      if (a[i] & (1 << j)) {
        last[i][j] = i;
      } else {
        last[i][j] = last[i + 1][j];
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < BITS; j++) {
      go[i][j] = n;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < BITS; j++) {
      if (a[i] & (1 << j)) {
        for (int k = 0; k < BITS; k++) {
          go[i][k] = min(go[i][k], go[last[i + 1][j]][k]);
        }
        go[i][j] = i;
      }
    }
  }
  for (int i = 0; i < q; i++) {
    int xi, yi;
    cin >> xi >> yi;
    xi--;
    yi--;
    bool flag = false;
    for (int j = 0; j < BITS; j++) {
      if ((a[yi] & (1 << j)) && (go[xi][j] <= yi)) {
        flag = true;
        break;
      };
    }
    cout << (flag ? "Shi" : "Fou") << endl;
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
