#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline long long int rand(long long int x, long long int y) {
  ++y;
  return (rng() % (y - x)) + x;
}
long long int n, q, A[(300006)], go[(300006)][20], dp[(300006)][20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  for (long long int i = 0; i < (long long int)n; ++i) cin >> A[i];
  for (long long int i = 0; i < (long long int)(300006); ++i)
    for (long long int j = 0; j < (long long int)20; ++j)
      go[i][j] = 1234567890ll, dp[i][j] = 1234567890ll;
  for (long long int bm = 0; bm < (long long int)20; ++bm) {
    vector<int> v;
    for (long long int i = 0; i < (long long int)n; ++i)
      if (A[i] & (1 << bm)) v.push_back(i);
    for (long long int i = 1; i < (long long int)v.size(); ++i) {
      go[v[i - 1]][bm] = v[i];
    }
  }
  for (long long int i = n - 1; i >= 0; --i) {
    for (long long int j = 0; j < (long long int)20; ++j) {
      if (A[i] & (1 << j))
        ;
      else
        continue;
      dp[i][j] = min(dp[i][j], i);
      for (long long int k = 0; k < (long long int)20; ++k) {
        if (go[i][j] != 1234567890ll) dp[i][k] = min(dp[i][k], dp[go[i][j]][k]);
      }
    }
  }
  for (long long int i = 0; i < (long long int)q; ++i) {
    long long int a, b;
    cin >> a >> b;
    --a, --b;
    bool can = 0;
    for (long long int j = 0; j < (long long int)20; ++j) {
      if (A[b] & (1 << j) && dp[a][j] <= b) can = 1;
    }
    cout << (can ? "Shi" : "Fou") << '\n';
  }
}
